//
//  KanZheKouCollectionCell.m
//  TravelYo
//
//  Created by lanou3g on 15/10/29.
//  Copyright © 2015年 TravelYo. All rights reserved.
//

#import "KanZheKouCollectionCell.h"

@interface KanZheKouCollectionCell ()

@property (nonatomic, assign) CGFloat selfWidth;

@property (nonatomic, assign) CGFloat selfHeight;

@end


@implementation KanZheKouCollectionCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _selfWidth = frame.size.width;
        _selfHeight = frame.size.height;
        [self addSubViews];
    }
    return self;
}


- (void)addSubViews
{
    _bianKuang = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _selfWidth - 5, _selfHeight - 5)];
    _bianKuang.backgroundColor = [UIColor whiteColor];
    //        _bianKuang.layer.borderWidth = 0.5;
    UIColor *color = [UIColor colorWithHue:146/255 saturation:146/255 brightness:146/255 alpha:1];
    //        _bianKuang.layer.borderColor = [color CGColor];
    _bianKuang.layer.shadowOffset = CGSizeMake(0, 1);
    _bianKuang.layer.shadowOpacity = 0.3;
    _bianKuang.layer.shadowColor = [color CGColor];
    
    [self.contentView addSubview:_bianKuang];

    
    _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _selfWidth - 5, _selfHeight / 2)];
   // _imageV.image = [UIImage imageNamed:@"e.png"];
    [_bianKuang addSubview:_imageV];
    
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, _selfHeight / 2, _selfWidth - 5, _selfHeight / 4)];
   // _titleLabel.text = @"呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵";
    _titleLabel.font = [UIFont systemFontOfSize:14];
    _titleLabel.numberOfLines = 0;
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [_bianKuang addSubview:_titleLabel];
    
    _monthsLabel = [[UILabel alloc] initWithFrame:CGRectMake(5,( _selfHeight * 3 ) / 4, _selfWidth - 10, _selfWidth / 8)];
    _monthsLabel.text = @"一月份, 二月份, 三月份, 四月份";
    
    _monthsLabel.font = [UIFont systemFontOfSize:12];
    _monthsLabel.alpha = 0.7;
    [_bianKuang addSubview:_monthsLabel];
    
    _priceOffLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, (_selfHeight * 7) / 8 - 5, _selfWidth / 5, _selfHeight / 8)];
    _priceOffLabel.text = @"25折";
    _priceOffLabel.font = [UIFont systemFontOfSize:12];
    _priceOffLabel.alpha = 0.7;
    [_bianKuang addSubview:_priceOffLabel];
    
    _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake((_selfWidth * 1) / 2 - 5, (_selfHeight * 7) / 8 - 5, _selfWidth / 3, _selfHeight / 8)];
    _priceLabel.text = @"1999";
    _priceLabel.textAlignment = NSTextAlignmentRight;
    _priceLabel.textColor = [UIColor redColor];
    [_bianKuang addSubview:_priceLabel];
    
    
    _yuanLabel = [[UILabel alloc] initWithFrame:CGRectMake((_selfHeight * 4) / 6 + 7 - 5, (_selfHeight * 7) / 8 - 5, (_selfHeight * 1) / 6, _selfHeight / 8)];
    _yuanLabel.text = @"元起";
    _yuanLabel.font = [UIFont systemFontOfSize:12];
    _yuanLabel.textColor = [UIColor redColor];
    _yuanLabel.textAlignment = NSTextAlignmentLeft;
    
    [_bianKuang addSubview:_yuanLabel];
}






- (void)awakeFromNib {
    // Initialization code
}

@end
